﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KeyboardRemapper
{
   public partial class frmEditMenuItem : Form
   {
      public static DialogResult EditMenuItem(frmAppMenu.AppInfo item)
      {
         frmEditMenuItem form = new frmEditMenuItem();
         form.txtDisplayName.Text = item.pDisplayName;
         form.txtExecute.Filename = item.pExePath;
         form.txtIconIndex.Value = item.pIconIndex;
         form.txtParameters.Text = item.pParameters;
         form.txtCaption.Text = item.pCaptionContains;
         DialogResult dr = form.ShowDialog();
         if (dr == DialogResult.OK)
         {
            item.pDisplayName = form.txtDisplayName.Text;
            item.pExePath = form.txtExecute.Filename;
            item.pIconIndex = (int)form.txtIconIndex.Value;
            item.pParameters = form.txtParameters.Text;
            item.pCaptionContains = form.txtCaption.Text;
         }
         return dr;
      }

      private frmEditMenuItem()
      {
         InitializeComponent();
      }
   }
}
